home *** CD-ROM | disk | FTP | other *** search
/ Cream of the Crop 20 / Cream of the Crop 20 (Terry Blount) (1996).iso / program / wdj0696.zip / ZOLMAN.ZIP / HINTBAR.H < prev    next >
C/C++ Source or Header  |  1996-02-19  |  2KB  |  68 lines

  1. // hintbar.h -- Class definitions for hint tag control bar classes.
  2.  
  3. #include <owl\buttonga.h>
  4. #include <owl\controlb.h>
  5.  
  6. //----------------------------------------------------------------------------
  7. //--- THintButtonGadget Definition
  8. //----------------------------------------------------------------------------
  9.  
  10. class THintButtonGadget : public TButtonGadget
  11. {
  12. public:
  13.    THintButtonGadget(TResId bmpResId, int id,
  14.       char far *tag = 0,           // hint tag displayed if mouse lingers
  15.       TType type = Command, bool enabled = false,
  16.       TState state = Up, bool repeat = false);
  17.    ~THintButtonGadget(void);
  18.  
  19. protected:
  20.    char far *text;
  21.  
  22.    void MouseEnter(uint modKeys, TPoint& p);
  23.    void MouseLeave(uint modKeys, TPoint& p);
  24. };
  25.  
  26.  
  27. //----------------------------------------------------------------------------
  28. //--- THintTagBar Definition
  29. //----------------------------------------------------------------------------
  30.  
  31. class THintTagBar : public TControlBar
  32. {
  33. public:
  34.    THintTagBar(TWindow *parent = 0, TTileDirection direction = Horizontal,
  35.       TFont *font = new TGadgetWindowFont, TColor textColor = TColor::Black,
  36.       TColor borderColor = TColor::Black,
  37.       TColor brushColor = TColor(255,255,115), TModule *module = 0);
  38.    ~THintTagBar(void);
  39.    bool IdleAction(long idleCount);
  40.  
  41.    TColor GetTextColor(void) { return colorTag; }
  42.    TPen *GetBorderPen(void) { return penTag; }
  43.    TBrush *GetBackgroundBrush(void) { return brushTag; }
  44.  
  45.    void SetTagDelay(int delay) { delayTag = delay; }
  46.    void CreateTag(const char far *text);
  47.    void DestroyTag(void);
  48.    TPoint &GetLastPoint(void) { return lastPoint; }
  49.  
  50. protected:
  51.    TWindow *tag;
  52.    int delayTag;
  53.    TPoint lastPoint;
  54.    bool tagsActive;
  55.    TColor colorTag;
  56.    TPen *penTag;
  57.    TBrush *brushTag;
  58.  
  59.    void EvLButtonDown(uint modKeys, TPoint& point);
  60.    void EvMouseMove(uint modKeys, TPoint& point);
  61.    void EvTimer(uint timerId);
  62.    void ShutDownTags(void);
  63.  
  64.    DECLARE_RESPONSE_TABLE(THintTagBar);
  65.    DECLARE_CASTABLE;
  66. };
  67.  
  68.